package com.imooc.order.dataobject;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Classname OrderMaster
 * @Description TODO
 * @Date 2019-04-24 17:58
 * @Created by Administrator
 * @Version 1.0
 */
@Data
@DynamicInsert
@DynamicUpdate
@Entity
public class OrderMaster {

    @Id
    private String orderId;

    private String buyerName;

    private String buyerPhone;

    private String buyerAddress;

    private String buyerOpenid;

    private BigDecimal orderAmount;

    /**
     * 订单状态 默认为0 新订单
     **/
    private Integer orderStatus;

    /**
     * 支付状态 默认为0 未支付
     **/
    private Integer payStatus;


    @Column(name="CREATE_TIME")
    @CreatedDate
    @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss")
    private Date createTime;

    private Date updateTime;


}
